import React from 'react';
import {Row, Col, Button} from 'antd';


class ServerInfoComtainer extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
    };
  }

  getTime(ver) {
    var date = new Date(ver);
    var Y = date.getFullYear() + '-';
    var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
    var D = date.getDate() + ' ';
    var h = date.getHours() + ':';
    var m = date.getMinutes() + ':';
    var s = date.getSeconds();
    return Y + M + D + h + m + s;
  }

  render() {

    return (
      <div>
        <Row>
          <Col span={24} style={{textAlign: "center"}}>服务器信息</Col>
        </Row>
        <p></p>
        <Row>
          <Col span={3} style={{textAlign: "right"}}>服务器：</Col>
          <Col span={12}>{this.props.server.name}</Col>
        </Row>
        <p></p>
        <Row>
          <Col span={3} style={{textAlign: "right"}}>服务器编号：</Col>
          <Col span={12}>{this.props.server.id}</Col>
        </Row>
        <p></p>
        <Row>
          <Col span={3} style={{textAlign: "right"}}>更新时间：</Col>
          <Col span={12}>{this.getTime(this.props.server.version)}</Col>
        </Row>

      </div>
    );
  }
}

export default ServerInfoComtainer;

